export const columns = [
  {
    title: '序号',
    dataIndex: 'index',
    key: 'index',
    sorter: (a, b) => a.index - b.index
  },
  {
    title: '商品名',
    dataIndex: 'name',
    key: 'name',
    sorter: (a, b) => a.name.localeCompare(b.name)
  },
  {
    title: '品牌',
    dataIndex: 'brandId',
    key: 'brandId',
    sorter: (a, b) => a.brandId - b.brandId
  },
  {
    title: '分类',
    dataIndex: 'category1Id',
    key: 'category1Id',
    sorter: (a, b) => a.category1Id - b.category1Id
  },
  {
    title: '图片',
    dataIndex: 'imgUrl',
    key: 'imgUrl'
  },
  {
    title: '描述',
    dataIndex: 'description',
    key: 'description',
    sorter: (a, b) => a.description.localeCompare(b.description)
  },
  {
    title: '库存',
    dataIndex: 'itemNum',
    key: 'itemNum',
    sorter: (a, b) => a.itemNum - b.itemNum
  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'status',
    sorter: (a, b) => a.status - b.status
  },
  {
    title: '审核状态',
    dataIndex: 'auditStatus',
    key: 'auditStatus',
    sorter: (a, b) => a.auditStatus - b.auditStatus
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    key: 'createTime',
    sorter: (a, b) => new Date(a.createTime).getTime() - new Date(b.createTime).getTime(),
  },
  {
    title: '操作',
    dataIndex: 'action',
    key: 'action'
  }
]

export const productSKU = [
  {
    title: 'SKU',
    dataIndex: 'skuId',
    key: 'skuId',
    sorter: (a, b) => a.skuId - b.skuId
  },
  {
    title: '名称',
    dataIndex: 'skuName',
    key: 'skuName',
    sorter: (a, b) => a.skuName.localeCompare(b.skuName)
  },
  {
    title: '图片',
    dataIndex: 'imgUrl',
    key: 'imgUrl'
  },
  {
    title: '原产地',
    dataIndex: 'origin',
    key: 'origin',
    sorter: (a, b) => a.origin.localeCompare(b.origin)
  },
  {
    title: '库存',
    dataIndex: 'stockNum',
    key: 'stockNum',
    sorter: (a, b) => a.stockNum - b.stockNum
  },
  {
    title: '售价',
    dataIndex: 'salePrice',
    key: 'salePrice',
    sorter: (a, b) => a.salePrice - b.salePrice
  },
  {

    title: '销量',
    dataIndex: 'saleNum',
    key: 'saleNum',
    sorter: (a, b) => a.saleNum - b.saleNum
  },
  {
    title: '重量',
    dataIndex: 'weight',
    key: 'weight',
    sorter: (a, b) => a.weight - b.weight
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    key: 'createTime',
    sorter: (a, b) => new Date(a.createTime).getTime() - new Date(b.createTime).getTime(),
  },
  {
    title: '操作',
    dataIndex: 'action',
    key: 'action'
  }
]

export const productStatusMap = {
  1: '已上架',
  0: '已下架',
  2: '草稿箱',
}

export const productAuditStatusMap = {
  0: '审核中',
  1: '审核通过',
  2: '审核不通过',
}

export const productStatusOptions = [
  {
    label: '全部',
    value: ''
  },
  {
    label: '已上架',
    value: 1
  },
  {
    label: '已下架',
    value: 0
  },
  {
    label: '草稿箱',
    value: 2
  }
]

export const productAuditStatusOptions = [
  {
    label: '全部',
    value: ''
  },
  {
    label: '审核中',
    value: 0
  },
  {
    label: '审核通过',
    value: 1
  },
  {
    label: '审核不通过',
    value: 2
  }
]
